import { useParams } from "react-router-dom";
import { useRequest } from "ahooks";
import { Flex } from "antd";
import DetailCard from "./components/detail-card";
import TableCard from "./components/table-card";
import { getOrderDetail } from "@/api/order";

export default function OrderDetail() {
  const { id } = useParams();
  const { data, loading } = useRequest(() => getOrderDetail(Number(id || 0)));

  return (
    <Flex gap={20} className="h-full">
      <DetailCard data={data?.businessOrder} loading={loading} />
      <TableCard id={Number(id || 0)} />
    </Flex>
  );
}
